# patch\_task

Use the methods described in this topic to get and modify settings of existing tasks.

## Required user role

See [Required Enterprise Manager permissions](https://help.qlik.com/en-US/enterprise-manager/May2026/Content/EnterpriseManager/EnterpriseManager_APIGuide/Introduction/AEMPermissions.htm).

## Payload overview

The payload should be in JSON format and determines:

* Setting values that will be changed

* Settings that will be disabled

As the API reflects the behavior and functionality of the Replicate UI, some settings require certain parent settings to be enabled before they can be modified. For example, it is not possible to enable the Optimize handling when LOB size is less than option when the Replicate LOB columns option is disabled. Therefore, if you are not sure whether the parent settings are enabled, to prevent errors, best practice is to include operations for enabling the parent settings in the request payload as well. Examples of how to do this are provided below.

Information noteTo verify a command in the Replicate console, you must first refresh your browser.

### Changing a setting value

#### Syntax

The syntax for changing a setting value is as follows:

```
[
	{ "op": "add", "path": "full path to setting", "value": new-value }
]
```

#### Example

The following example shows how to change the Maximum number of tables setting in the Full Load Tuning tab.

```
[
	{ "op": "add", "path": "/full_load_sub_tasks", "value": 100 }
]
```

### Reverting to the default setting value

You revert a setting to its default value by using the "remove" command. If the setting is dependent on other settings being enabled, you also need to enable those settings before you can revert the specific setting to its default. If you are aware that the related settings are already enabled, then you can simply use the "remove" operation.

#### Example

In the following example, the user wants to revert the Chunk size (KB) (`lob_chunk_size`) setting to its default value. Changing this setting or restoring its default requires the Replicate LOB columns and Allow unlimited LOB size settings to be enabled. Because the user is not sure they are enabled, he includes operations for enabling them in the request payload.

```
[
	{ "op": "add", "path": "/common_settings/support_lobs", "value": true },
	{ "op": "add", "path": "/common_settings/lob_max_size", "value": 0 },
	{ "op": "remove", "path": "/common_settings/lob_chunk_size" }
]
```

If the user knew beforehand that the Replicate LOB columns and Allow unlimited LOB size settings were enabled, he would only need to include the "remove" operation in the request payload.

```
[
	{ "op": "remove", "path": "/common_settings/lob_chunk_size" }
]
```

### Enabling or disabling a setting (the equivalent of selecting or clearing a check box)

You enable a setting using the "add" operation. You can disable a setting using the "remove" operation or by setting the value to "false".

#### Enabling a setting

Syntax

The syntax for enabling a setting is as follows:

```
[
	{ "op": "add", "path": "path_to_setting", "value": true }
]
```

Example

To enable the Replicate LOB columns option:

```
[
	{ "op": "add", "path": "/common_settings/support_lobs", "value": true }
]
```

#### Disabling a setting using the "remove" operation

Syntax

The syntax for disabling a setting using the "remove" operation is as follows:

```
[
	{ "op": "remove", "path": "path_to_setting" }
]
```

Example

To disable the Replicate LOB columns option:

```
[
	{ "op": "remove", "path": "/common_settings/support_lobs" }
]
```

#### Disabling a setting by setting its value to "false"

Syntax

The syntax for disabling a setting by setting its value to "false" is as follows:

```
[
	{ "op": "add", "path": "path_to_setting", "value": false }
]
```

Example

To disable the Replicate LOB columns option:

```
[
	{ "op": "add", "path": "/common_settings/support_lobs", "value": false }
]
```

## Configuring task settings

Call patch\_task\_settings to modify all supported task settings, except the task description.

### Syntax

def patch\_task\_settings(self, payload, server, task)

### Parameters

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| payload | STRING (JSON) | A JSON payload containing the settings to modify. |
| server | STRING | The Replicate server name as defined in Enterprise Manager.<br><br>Example:<br><br>myrepsrv1 |
| task | STRING | The name of an existing task. |

### Payloads for supported settings

[](https://help.qlik.com/en-US/enterprise-manager/Content/EnterpriseManager/EnterpriseManager_APIGuide/PythonAPI/api_aem_gettask%20properties.htm)

#### Target metadata

| UI equivalent | Payload with examples |
| --- | --- |
| Replicate LOB columns | Enable LOB column replication:<br><br>```<br>[<br>	{ "op": "add", "path": "/common_settings/support_lobs", "value": true }<br>]<br>```<br><br>Disable LOB column replication:<br><br>```<br>[<br>	{ "op": "remove", "path": "/common_settings/support_lobs" }<br>]<br>``` |
| Allow unlimited LOB size | Set the Limit LOB size to (KB) value to 0:<br><br>```<br>[<br>	{ "op": "add", "path": "/common_settings/support_lobs", "value": true },<br>	{ "op": "add", "path": "/common_settings/lob_max_size", "value": 0 }<br>]<br>``` |
| Optimize handling when LOB size is less than | Enable by setting a Optimize handling when LOB size is less than (inline\_lob\_max\_size) value:<br><br>```<br>[<br>	{ "op": "add", "path": "/common_settings/support_lobs", "value": true },<br>	{ "op": "add", "path": "/common_settings/lob_max_size", "value": 0 },<br>	{ "op": "add", "path": "/common_settings/inline_lob_max_size" , "value": 1 }<br>]<br>``` |
| Chunk size (KB) | Override the default Chunk size (lob\_chunk\_size):<br><br>```<br>[<br>	{ "op": "add", "path": "/common_settings/support_lobs", "value": true },<br>	{ "op": "add", "path": "/common_settings/lob_max_size", "value": 0 },<br>	{ "op": "add", "path": "/common_settings/lob_chunk_size" , "value": 100 }<br>]<br>``` |
| Limit LOB size to (KB) | Set Limit LOB size to (KB) (lob\_max\_size) to a value greater than 0.<br><br>```<br>[<br>	{ "op": "add", "path": "/common_settings/support_lobs", "value": true },<br>	{ "op": "add", "path": "/common_settings/lob_max_size", "value": 44 }<br>]<br>``` |
| Target table schema | Set a new Target table schema (default\_schema):<br><br>```<br>[<br>	{ "op": "add", "path": "/target_settings/default_schema", "value": "NewTargetSchema" }<br>]<br>``` |

[](https://help.qlik.com/en-US/enterprise-manager/Content/EnterpriseManager/EnterpriseManager_APIGuide/PythonAPI/api_aem_gettask%20properties.htm)

#### Control tables

| UI equivalent | Payload with examples |
| --- | --- |
| Create target control tables in schema | Set a Create target control tables in schema (control\_schema) value:<br><br>```<br>[<br>	{ "op": "add", "path": "/target_settings/control_schema", "value": "NewTargetSchema" }<br>]<br>``` |
| Create target control tables in tablespace | Set a Create target control tables in tablespace (control\_table\_tablespace) value:<br><br>```<br>[<br>	{ "op": "add", "path": "/target_settings/control_table_tablespace", "value": "NewTargetSchema" }<br>]<br>``` |
| Create target control table indexes in tablespace | Set a Create target control table indexes in tablespace (control\_index\_tablespace) value:<br><br>```<br>[<br>	{ "op": "add", "path": "/target_settings/control_index_tablespace", "value": "NewTargetSchema" }<br>]<br>``` |
| Replication Status | Create the Replication Status control table on the target:<br><br>```<br>[<br>	{ "op": "add", "path": "/common_settings/status_table_enabled", "value": true }<br>]<br>``` |
| Update Every (Minutes) | Specify an Update Every (Minutes) value:<br><br>```<br>[<br>	{ "op": "add", "path": "/common_settings/status_table_enabled", "value": true },<br>	{ "op": "add", "path": "/sorter_settings/status_table_update_interval_seconds", "value": 1440 }<br>]<br>``` |
| Suspended Tables | Create the Suspended Tables control table on the target:<br><br>```<br>[<br>	{ "op": "add", "path": "/common_settings/suspended_tables_table_enabled", "value": true }<br>]<br>``` |
| Replication History | Create the Replication History control table on the target:<br><br>```<br>[<br>	{ "op": "add", "path": "/common_settings/history_table_enabled", "value": true }<br>]<br>``` |
| Update Every (Minutes) | Specify an Update Every (Minutes) value:<br><br>```<br>[<br>	{ "op": "add", "path": "/common_settings/history_table_enabled", "value": true },<br>	{ "op": "add", "path": "/common_settings/history_timeslot", "value": 24 }<br>]<br>``` |
| DDL History | Create the DDL History control table on the target:<br><br>```<br>[<br>	{ "op": "add", "path": "/common_settings/ddl_history_table_enabled", "value": true }<br>]<br>``` |
| Change Data Partitions | Create the Change Data Partitions control table on the target:<br><br>```<br>[<br>	{ "op": "add", "path": "/common_settings/change_data_batching_table_enabled", "value": true }<br>]<br>``` |

[](https://help.qlik.com/en-US/enterprise-manager/Content/EnterpriseManager/EnterpriseManager_APIGuide/PythonAPI/api_aem_gettask%20properties.htm)

#### Full Load Tuning

| UI equivalent | Payload with examples |
| --- | --- |
| Maximum number of tables | Set a "Maximum number of tables" value:<br><br>```<br>[<br>	{ "op": "add", "path": "/full_load_sub_tasks", "value": 100 }<br>]<br>``` |

[](https://help.qlik.com/en-US/enterprise-manager/Content/EnterpriseManager/EnterpriseManager_APIGuide/PythonAPI/api_aem_gettask%20properties.htm)

#### Store Changes

| UI equivalent | Payload with examples |
| --- | --- |
| Store Changes | Enable<br>Store Changes (save\_changes\_enabled):<br><br>```<br>[<br>	{ "op": "add", "path": "/common_settings/save_changes_enabled", "value": true }<br>]<br>``` |
| On UPDATE | Set On UPDATE: Store after<br>image only (skip\_before\_image):<br><br>```<br>[<br>	{ "op": "add", "path": "/common_settings/change_table_settings/skip_before_image", "value": true }<br>]<br>```<br><br>Set<br>On UPDATE: Store before and after image (skip\_before\_image):<br><br>```<br>[<br>	{ "op": "add", "path": "/common_settings/change_table_settings/skip_before_image", "value": false }<br>]<br>``` |
| Change Data Partitioning:<br>Partition every | Enable Change Data Partitioning with the default partitioning interval (one hours):<br><br>```<br>[<br>	{ "op": "add", "path": "/common_settings/save_changes_enabled", "value": true },<br>	{ "op": "add", "path": "/common_settings/change_table_settings/header_columns_settings/batch_name", "value": true },<br>	{ "op": "add", "path": "/common_settings/data_batching_settings/trigger_mode", "value": "DATA_BATCH_TRIGGER_INTERVAL" },<br>	{ "op": "add", "path": "/common_settings/change_data_batching_table_enabled", "value": true }<br>]<br>```<br><br>Disable<br>Change Data Partitioning:<br><br>```<br>[<br>	{ "op": "remove", "path": "/common_settings/save_changes_enabled" },<br>	{ "op": "remove", "path": "/common_settings/change_table_settings/header_columns_settings/batch_name" },<br>	{ "op": "remove", "path": "/common_settings/data_batching_settings/trigger_mode" },<br>	{ "op": "remove", "path": "/common_settings/change_data_batching_table_enabled" }<br>]<br>```<br><br>Specify a "Partitioning base time" time value:<br><br>```<br>[<br>	{ "op": "add", "path": "/common_settings/save_changes_enabled", "value": true },<br>	{ "op": "add", "path": "/common_settings/change_table_settings/header_columns_settings/batch_name", "value": true },<br>	{ "op": "add", "path": "/common_settings/data_batching_settings/trigger_mode", "value": "DATA_BATCH_TRIGGER_INTERVAL" },<br>	{ "op": "add", "path": "/common_settings/data_batching_settings/interval_hours", "value": 2 },<br>	{ "op": "add", "path": "/common_settings/data_batching_settings/start_hour", "value": 3 },<br>	{ "op": "add", "path": "/common_settings/data_batching_settings/start_minute", "value": 30 },<br>	{ "op": "add", "path": "/common_settings/change_data_batching_table_enabled", "value": true }<br>]<br>``` |

[](https://help.qlik.com/en-US/enterprise-manager/Content/EnterpriseManager/EnterpriseManager_APIGuide/PythonAPI/api_aem_gettask%20properties.htm)

#### Change Processing Mode

| UI equivalent | Payload with examples |
| --- | --- |
| Change Processing Mode | Switch to<br>"Transactional apply"<br><br>```<br>[<br>	{ "op": "add", "path": "/common_settings/batch_apply_enabled", "value": false }<br>]<br>```<br><br>Switch<br>to "Batch optimized apply"<br><br>```<br>[<br>	{ "op": "add", "path": "/common_settings/batch_apply_enabled", "value": true }<br>]<br>``` |

[](https://help.qlik.com/en-US/enterprise-manager/Content/EnterpriseManager/EnterpriseManager_APIGuide/PythonAPI/api_aem_gettask%20properties.htm)

#### Batch optimized apply

| UI equivalent | Payload with examples |
| --- | --- |
| Batch Tuning | Change<br>the "Apply batched changes in intervals: Longer than (seconds)" value<br><br>```<br>[<br>	{ "op": "add", "path": "/common_settings/batch_apply_timeout_min", "value": 24 }<br>]<br>```<br><br>Return<br>to the default "Apply batched changes in intervals: Longer than (seconds)" value<br><br>```<br>[<br>	{ "op": "remove", "path": "/common_settings/batch_apply_timeout_min" }<br>]<br>```<br><br>Change<br>the "Apply batched changes in intervals: But less than (seconds)" value<br><br>```<br>[<br>	{ "op": "add", "path": "/common_settings/batch_apply_timeout", "value": 24 }<br>]<br>```<br><br>Return<br>to the default "Longer than (seconds)" and "But less than<br>(seconds)" values<br><br>```<br>[<br>	{ "op": "remove", "path": "/common_settings/batch_apply_timeout" }<br>]<br>```<br><br>Override the default "Force apply a batch when processing memory exceeds (MB)" value<br><br>```<br>[<br>	{ "op": "add", "path": "/common_settings/batch_apply_memory_limit", "value": 24 }<br>]<br>```<br><br>Return<br>to the default "Force apply a batch when processing memory exceeds<br>(MB)" value<br><br>```<br>[<br>	{ "op": "remove", "path": "/common_settings/batch_apply_memory_limit" }<br>]<br>```<br><br>Enable<br>"Limit the number of changes applied per change processing statement<br>to"<br><br>```<br>[<br>	{ "op": "add", "path": "/common_settings/batch_split_size", "value": 1000 }<br>]<br>```<br><br>Disable<br>the "Limit the number of changes applied per change processing statement<br>to"<br><br>```<br>[<br>	{ "op": "remove", "path": "/common_settings/batch_split_size" }<br>]<br>``` |

[](https://help.qlik.com/en-US/enterprise-manager/Content/EnterpriseManager/EnterpriseManager_APIGuide/PythonAPI/api_aem_gettask%20properties.htm)

#### Transactional apply

| UI equivalent | Payload with examples |
| --- | --- |
| Batch Tuning | Change<br>"Minimum number of changes per transaction" value<br><br>```<br>[<br>	{ "op": "add", "path": "/common_settings/batch_apply_enabled", "value": false },<br>	{ "op": "add", "path": "/target_settings/min_transaction_size", "value": 1500 }<br>]<br>```<br><br>Return<br>to default "Minimum number of changes per transaction" value"<br><br>```<br>[<br>	{ "op": "add", "path": "/common_settings/batch_apply_enabled", "value": false },<br>	{ "op": "remove", "path": "/target_settings/min_transaction_size" }<br>]<br>```<br><br>Change<br>"Maximum time to batch transactions before applying (seconds)"<br>value<br><br>```<br>[<br>	{ "op": "add", "path": "/common_settings/batch_apply_enabled", "value": false },<br>	{ "op": "remove", "path": "/target_settings/commit_timeout", "value": 500 }<br>]<br>```<br><br>Return<br>to default "Minimum number of changes per transaction" value"<br><br>```<br>[<br>	{ "op": "add", "path": "/common_settings/batch_apply_enabled", "value": false },<br>	{ "op": "remove", "path": "/target_settings/commit_timeout" }<br>]<br>``` |
| Transaction Offload Tuning | Change "Total transactions<br>memory size exceeds (MB)" value:<br><br>```<br>[<br>	{ "op": "add", "path": "/common_settings/batch_apply_enabled", "value": false },<br>	{ "op": "add", "path": "/sorter_settings/local_transactions_storage/memory_limit_total", "value": 1500 }<br>]<br>```<br><br>Return<br>to default "Total transactions memory size exceeds (MB):"<br>value:<br><br>```<br>[<br>	{ "op": "add", "path": "/common_settings/batch_apply_enabled", "value": false },<br>	{ "op": "remove", "path": "/sorter_settings/local_transactions_storage/memory_limit_total" }<br>]<br>```<br><br>Change<br>"Transactions duration exceeds (seconds)" value<br><br>```<br>[<br>	{ "op": "add", "path": "/common_settings/batch_apply_enabled", "value": false },<br>	{ "op": "add", "path": "/sorter_settings/local_transactions_storage/memory_keep_time", "value": 80 }<br>]<br>```<br><br>Return<br>to default "Transactions duration exceeds (seconds)"<br><br>```<br>[<br>	{ "op": "add", "path": "/common_settings/batch_apply_enabled", "value": false },<br>	{ "op": "remove", "path": "/sorter_settings/local_transactions_storage/memory_keep_time" }<br>]<br>``` |

[](https://help.qlik.com/en-US/enterprise-manager/Content/EnterpriseManager/EnterpriseManager_APIGuide/PythonAPI/api_aem_gettask%20properties.htm)

#### Feature Flag

| Action | Payload with examples |
| --- | --- |
| Add new Feature Flag | Add new feature flag:<br><br>```<br>[<br>{<br>"op": "add",<br>"path": "/common_settings/feature_flags/<flag-name>",<br>"value": "<value>"<br>}<br>]<br>``` |
| Remove<br>Feature Flag | Remove existing Feature Flag<br><br>```<br>[<br>{<br>"op": "remove", "path": "/common_settings/feature_flags/<flag-name>"<br>}<br>]<br>``` |

### Example

```
settings = json.dumps([{"op": "add", "path": "/common_settings/support_lobs", "value": True}])
example_program.aem_client.patch_task_settings(settings, 'MyServerName', 'MyTaskName')
```

## Setting or removing the task description

Call put\_task\_properties to set or remove the task description.

### Syntax

def put\_task\_properties(payload, self, server, task)

### Parameters

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| payload | AemTaskProperties | The payload as shown below. |
| server | string | The Replicate server name as defined in Enterprise Manager.<br><br>Example:<br><br>myrepsrv1 |
| task | string | The name of an existing task. |

### Payload

| Action | Payload with examples |
| --- | --- |
| Add a valid description | Add a description<br>(Uppercase/Lowercase/Numbers/Space/Special Characters)<br><br>```<br>{<br>"description": "important task"<br>}<br>``` |
| Remove<br>description | Remove the description<br><br>```<br>{<br>"description": ""<br>}<br>``` |

### Example

```
description = AemTaskProperties({"description": "important task"})
example_program.aem_client.put_task_properties(description, 'MyServerName', 'MyTaskName')
```

## Configuring error handling

Call put\_task\_error\_behavior to modify the error handling settings.

### Syntax

def put\_task\_error\_behavior(self, payload, server, task)

### Parameters

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| payload | AemTaskErrorBehavior | The JSON payload consisting of the error handling settings to change. |
| server | string | The Replicate server name as defined in Enterprise Manager.<br><br>Example:<br><br>myrepsrv1 |
| task | string | The name of an existing task. |

### Payload

Warning noteDue to a known limitation, you always need to include all of the current error handling settings in the payload, even if you only want to modify only a single setting.

| Action | Payload with examples |
| --- | --- |
| Environmental errors | Change the "Maximum retry count" value:<br><br>```<br>{<br>"error_behavior": {<br>"recoverable_error_behavior": {<br>"count": 2<br>}<br>}<br>}<br>```<br><br>Restore the default "Maximum retry count"<br><br>```<br>{<br>"error_behavior": {<br>"recoverable_error_behavior": {<br>"count": -1<br>}<br>}<br>}<br>```<br><br>Disable the "Maximum retry count" option<br><br>```<br>{<br>"error_behavior": {<br>"recoverable_error_behavior": {<br>"count": 0<br>}<br>}<br>}<br>```<br><br>Enable the "Increase retry interval for long outages" option<br><br>```<br>{<br>"error_behavior": {<br>"recoverable_error_behavior": {<br>"throttling": true<br>}<br>}<br>}<br>```<br><br>Disable the "Increase retry interval for long outages" option<br><br>```<br>{<br>"error_behavior": {<br>"recoverable_error_behavior": {<br>"throttling": false<br>}<br>}<br>}<br>```<br><br>Change the "Maximum retry interval (seconds)" value<br><br>```<br>{<br>"error_behavior": {<br>"recoverable_error_behavior": {<br>"throttling_max": 2000<br>}<br>}<br>}<br>``` |
| Data errors:<br>For data truncation errors | Set "For data truncation<br>errors: Ignore record"<br><br>```<br>{<br>"error_behavior": {<br>"data_error_behavior": {<br>"truncation_policy": "ERROR_POLICY_IGNORE_RECORD"<br>}<br>}<br>}<br>```<br><br>Set "For data truncation errors: Suspend table"<br><br>```<br>{<br>"error_behavior": {<br>"data_error_behavior": {<br>"truncation_policy": "ERROR_POLICY_SUSPEND_TABLE"<br>}<br>}<br>}<br>```<br><br>Set "For data truncation errors: Stop Task"<br><br>```<br>{<br>"error_behavior": {<br>"data_error_behavior": {<br>"truncation_policy": "ERROR_POLICY_STOP_TASK"<br>}<br>}<br>}<br>```<br><br>Set "For data truncation errors: Log record to the exceptions table"<br><br>```<br>{<br>"error_behavior": {<br>"data_error_behavior": {<br>"truncation_policy": "ERROR_POLICY_LOG_ERROR"<br>}<br>}<br>}<br>``` |
| Data errors:<br>For NOT NULL constraint violations: | Enable "Check"<br>option for "For NOT NULL constraint violations"<br><br>```<br>{<br>"error_behavior": {<br>"data_error_behavior": {<br>"nullability_check_data_error": "YES"<br>}<br>}<br>}<br>```<br><br>Enable<br>"Don't check" option for "For NOT NULL constraint<br>violations"<br><br>```<br>{<br>"error_behavior": {<br>"data_error_behavior": {<br>"nullability_check_data_error": "NO"<br>}<br>}<br>}<br>```<br><br>Enable<br>"Endpoint-determined (Check)" option for "For NOT NULL<br>constraint violations"<br><br>```<br>{<br>"error_behavior": {<br>"data_error_behavior": {<br>"nullability_check_data_error": "ENDPOINT_DETERMINED"<br>}<br>}<br>}<br>```<br><br>Set<br>"For NOT NULL constraint violations: Ignore record"<br><br>```<br>{<br>"error_behavior": {<br>"data_error_behavior": {<br>"nullability_policy": "ERROR_POLICY_IGNORE_RECORD"<br>}<br>}<br>}<br>```<br><br>Set<br>"For NOT NULL constraint violations: Suspend table"<br><br>```<br>{<br>"error_behavior": {<br>"data_error_behavior": {<br>"nullability_policy": "ERROR_POLICY_SUSPEND_TABLE"<br>}<br>}<br>}<br>```<br><br>Set<br>"For NOT NULL constraint violations: Stop Task"<br><br>```<br>{<br>"error_behavior": {<br>"data_error_behavior": {<br>"nullability_policy": "ERROR_POLICY_STOP_TASK"<br>}<br>}<br>}<br>```<br><br>Set<br>"For NOT NULL constraint violations: Log record to the exceptions<br>table"<br><br>```<br>{<br>"error_behavior": {<br>"data_error_behavior": {<br>"nullability_policy": "ERROR_POLICY_LOG_ERROR"<br>}<br>}<br>}<br>``` |
| Data errors:<br>For other data errors | Set "For data truncation<br>errors: Ignore record"<br><br>```<br>{<br>"error_behavior": {<br>"data_error_behavior": {<br>"policy": "ERROR_POLICY_IGNORE_RECORD"<br>}<br>}<br>}<br>```<br><br>Set<br>"For data truncation errors: Suspend table"<br><br>```<br>{<br>"error_behavior": {<br>"data_error_behavior": {<br>"policy": "ERROR_POLICY_SUSPEND_TABLE"<br>}<br>}<br>}<br>```<br><br>Set<br>"For data truncation errors: Stop Task"<br><br>```<br>{<br>"error_behavior": {<br>"data_error_behavior": {<br>"policy": "ERROR_POLICY_STOP_TASK"<br>}<br>}<br>}<br>```<br><br>Set<br>"For data truncation errors: Log record to the exceptions table"<br><br>```<br>{<br>"error_behavior": {<br>"data_error_behavior": {<br>"policy": "ERROR_POLICY_LOG_ERROR"<br>}<br>}<br>}<br>```<br><br>Enable<br>"Escalate handling when data errors reach (per table)" checkbox<br><br>```<br>{<br>"error_behavior": {<br>"data_error_behavior": {<br>"escalation_count": 50<br>}<br>}<br>}<br>```<br><br>Disable<br>"Escalate handling when data errors reach (per table)" checkbox<br><br>```<br>{<br>"error_behavior": {<br>"data_error_behavior": {<br>"escalation_count": 0<br>}<br>}<br>}<br>```<br><br>Set<br>"Escalation action: Stop Task" for data errors<br><br>```<br>{<br>"error_behavior": {<br>"data_error_behavior": {<br>"escalation_count": 50,<br>"escalation_policy": "ERROR_POLICY_STOP_TASK"<br>}<br>}<br>}<br>```<br><br>Set<br>"Escalation action: Suspend table" for data errors<br><br>```<br>{<br>"error_behavior": {<br>"data_error_behavior": {<br>"escalation_count": 50,<br>"escalation_policy": "ERROR_POLICY_SUSPEND_TABLE"<br>}<br>}<br>}<br>``` |
| Table Errors | Set "When encountering a<br>table error: Stop Task"<br><br>```<br>{<br>"error_behavior": {<br>"table_error_behavior": {<br>"policy": "ERROR_POLICY_STOP_TASK"<br>}<br>}<br>}<br>```<br><br>Set<br>"When encountering a table error: Suspend table"<br><br>```<br>{<br>"error_behavior": {<br>"table_error_behavior": {<br>"policy": "ERROR_POLICY_SUSPEND_TABLE"<br>}<br>}<br>}<br>```<br><br>Enable<br>"Escalate handling when data errors reach (per table)" checkbox<br><br>```<br>{<br>"error_behavior": {<br>"table_error_behavior": {<br>"escalation_count": 50<br>}<br>}<br>}<br>```<br><br>Disable<br>"Escalate handling when data errors reach (per table)"checkbox<br><br>```<br>{<br>"error_behavior": {<br>"table_error_behavior": {<br>"escalation_count": 0<br>}<br>}<br>}<br>``` |
| Apply conflict:<br>No record found for applying DELETE | Set "No record found for<br>applying DELETE: Ignore record"<br><br>```<br>{<br>"error_behavior": {<br>"apply_error_behavior": {<br>"delete_policy": "ERROR_POLICY_IGNORE_RECORD"<br>}<br>}<br>}<br>```<br><br>Set<br>"No record found for applying DELETE: Suspend table"<br><br>```<br>{<br>"error_behavior": {<br>"apply_error_behavior": {<br>"delete_policy": "ERROR_POLICY_SUSPEND_TABLE"<br>}<br>}<br>}<br>```<br><br>Set<br>"No record found for applying DELETE: Stop Task"<br><br>```<br>{<br>"error_behavior": {<br>"apply_error_behavior": {<br>"delete_policy": "ERROR_POLICY_STOP_TASK"<br>}<br>}<br>}<br>```<br><br>Set<br>"No record found for applying DELETE: Log record to the exceptions<br>table"<br><br>```<br>{<br>"error_behavior": {<br>"apply_error_behavior": {<br>"delete_policy": "ERROR_POLICY_LOG_ERROR"<br>}<br>}<br>}<br>``` |
| Apply conflict:<br>Duplicate key when applying INSERT | Set "Duplicate key when<br>applying INSERT: Ignore record" of Apply Conflict<br><br>```<br>{<br>"error_behavior": {<br>"apply_error_behavior": {<br>"insert_policy": "ERROR_POLICY_IGNORE_RECORD"<br>}<br>}<br>}<br>```<br><br>Set<br>"Duplicate key when applying INSERT: Suspend table"<br><br>```<br>{<br>"error_behavior": {<br>"apply_error_behavior": {<br>"insert_policy": "ERROR_POLICY_SUSPEND_TABLE"<br>}<br>}<br>}<br>```<br><br>Set<br>"Duplicate key when applying INSERT: Stop Task"<br><br>```<br>{<br>"error_behavior": {<br>"apply_error_behavior": {<br>"insert_policy": "ERROR_POLICY_STOP_TASK"<br>}<br>}<br>}<br>```<br><br>Set<br>"Duplicate key when applying INSERT: Log record to the exceptions<br>table"<br><br>```<br>{<br>"error_behavior": {<br>"apply_error_behavior": {<br>"insert_policy": "ERROR_POLICY_LOG_ERROR"<br>}<br>}<br>}<br>```<br><br>Set<br>"Duplicate key when applying INSERT: UPDATE the existing target<br>record"<br><br>```<br>{<br>"error_behavior": {<br>"apply_error_behavior": {<br>"insert_policy": "ERROR_POLICY_MERGE_MODE"<br>}<br>}<br>}<br>``` |
| Apply conflict:<br>No record found for applying an UPDATE | Set "No record found for<br>applying an UPDATE: Ignore record"<br><br>```<br>{<br>"error_behavior": {<br>"apply_error_behavior": {<br>"update_policy": "ERROR_POLICY_IGNORE_RECORD"<br>}<br>}<br>}<br>```<br><br>Set<br>"No record found for applying an UPDATE: Suspend table"<br><br>```<br>{<br>"error_behavior": {<br>"apply_error_behavior": {<br>"update_policy": "ERROR_POLICY_SUSPEND_TABLE"<br>}<br>}<br>}<br>```<br><br>Set<br>"No record found for applying an UPDATE: Stop Task"<br><br>```<br>{<br>"error_behavior": {<br>"apply_error_behavior": {<br>"update_policy": "ERROR_POLICY_STOP_TASK"<br>}<br>}<br>}<br>```<br><br>Set<br>"No record found for applying an UPDATE: Log record to the exceptions<br>table"<br><br>```<br>{<br>"error_behavior": {<br>"apply_error_behavior": {<br>"update_policy": "ERROR_POLICY_LOG_ERROR"<br>}<br>}<br>}<br>```<br><br>Set<br>"No record found for applying an UPDATE: INSERT the missing target<br>record"<br><br>```<br>{<br>"error_behavior": {<br>"apply_error_behavior": {<br>"update_policy": "ERROR_POLICY_UPSERT_MODE"<br>}<br>}<br>}<br>``` |
| Apply conflict:<br>Escalate handling when data errors reach (per table) | Enable "Escalate handling<br>when data errors reach (per table)" checkbox<br><br>```<br>{<br>"error_behavior": {<br>"apply_error_behavior": {<br>"escalation_count": 50<br>}<br>}<br>}<br>```<br><br>Disable<br>"Escalate handling when data errors reach (per table)" checkbox<br><br>```<br>{<br>"error_behavior": {<br>"apply_error_behavior": {<br>"escalation_count": 0<br>}<br>}<br>}<br>```<br><br>Set<br>"Escalation action: Stop Task"<br><br>```<br>{<br>"error_behavior": {<br>"apply_error_behavior": {<br>"escalation_count": 50,<br>"escalation_policy": "ERROR_POLICY_STOP_TASK"<br>}<br>}<br>}<br>```<br><br>Set<br>"Escalation action: Suspend table"<br><br>```<br>{<br>"error_behavior": {<br>"apply_error_behavior": {<br>"escalation_count": 50,<br>"escalation_policy": "ERROR_POLICY_SUSPEND_TABLE"<br>}<br>}<br>}<br>```<br><br>Set<br>"Escalation action: Log record to the exceptions table"<br><br>```<br>{<br>"error_behavior": {<br>"apply_error_behavior": {<br>"escalation_count": 50,<br>"escalation_policy": "ERROR_POLICY_LOG_ERROR"<br>}<br>}<br>}<br>``` |

### Example

```
example_program = ExamplePythonProgram()
    task_error_handling = {
        "error_behavior": {
            "apply_error_behavior": {
                "delete_policy": "ERROR_POLICY_LOG_ERROR",
                "insert_policy": "ERROR_POLICY_LOG_ERROR",
                "update_policy": "ERROR_POLICY_LOG_ERROR",
                "escalation_count": 0,
                "escalation_policy": "ERROR_POLICY_SUSPEND_TABLE",
                "full_load_ignore_conflicts": True
            },
            "table_error_behavior": {
                "policy": "ERROR_POLICY_SUSPEND_TABLE",
                "escalation_count": 0,
                "escalation_policy": "ERROR_POLICY_STOP_TASK"
            },
            "data_error_behavior": {
                "policy": "ERROR_POLICY_LOG_ERROR",
                "escalation_count": 0,
                "escalation_policy": "ERROR_POLICY_SUSPEND_TABLE",
                "truncation_policy": "ERROR_POLICY_LOG_ERROR",
                "nullability_policy": "ERROR_POLICY_SUSPEND_TABLE",
                "nullability_check_data_error": "ENDPOINT_DETERMINED"
            },
            "recoverable_error_behavior": {
                "count": -1,
                "interval": 5,
                "throttling": True,
                "throttling_max": 1800,
                "abnormal_count": 5,
                "recovery_grace_period": 10,
                "max_table_repeated_fail_count": 3
            }
        }
    }
    settings_json_string = json.dumps(task_error_handling)
    aem_task_error_behavior = AemTaskErrorBehavior(settings_json_string)
    example_program.aem_client.put_task_error_behavior(aem_task_error_behavior, "MyServerName", "MyTaskName")
```

## Configuring logging

Call put\_task\_loggers to modify the logging settings.

### Syntax

def put\_task\_loggers(self, payload, server, task)

### Parameters

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| payload | AemTaskLoggers | The JSON payload consisting of the logging settings to change. |
| server | string | The Replicate server name as defined in Enterprise Manager.<br><br>Example:<br><br>myrepsrv1 |
| task | string | The name of an existing task. |

### Payload

| Action | Payload with examples |
| --- | --- |
| Changing the global logging level | Change the global logging level to TRACE:<br><br>```<br>{<br>"loggers":[<br>{<br>"logger_type": "AT_GLOBAL",<br>"log_level": "DEBUG"<br>}<br>]<br>}<br>```<br><br>Change the global logging level to VERBOSE:<br><br>```<br>{<br>"loggers":[<br>{<br>"logger_type": "AT_GLOBAL",<br>"log_level": "DETAILED_DEBUG"<br>}<br>]<br>}<br>```<br><br>Change the global logging level to WARNING:<br><br>```<br>{<br>"loggers":[<br>{<br>"logger_type": "AT_GLOBAL",<br>"log_level": "WARNING"<br>}<br>]<br>}<br>```<br><br>Change the global logging level to ERROR:<br><br>```<br>{<br>"loggers":[<br>{<br>"logger_type": "AT_GLOBAL",<br>"log_level": "ERROR"<br>}<br>]<br>}<br>``` |
| Change the logging level of a specific component | Change "UTILITIES" to<br>Trace level:<br><br>```<br>{<br>"loggers":[<br>{<br>"logger_type": "UTILITIES",<br>"log_level": "DETAILED_DEBUG"<br>}<br>]<br>}<br>``` |
| Change the global logging level and the logging level of a specific component | Change the global logging level to<br>TRACE and the logging level of a specific component to ERROR:<br><br>```<br><br>{<br>"loggers": [<br>{<br>"logger_type": "AT_GLOBAL",<br>"log_level": "DETAILED_DEBUG"<br>},<br>{<br>"logger_type": "STREAM",<br>"log_level": "ERROR"<br>}<br>]<br>}<br>``` |
| Change<br>multiple components to different logging levels | Change "ADDONS" to<br>VERBOSE and "STREAM" to ERROR<br><br>```<br><br>{<br>"loggers": [<br>{<br>"logger_type": "ADDONS",<br>"log_level": "DETAILED_DEBUG"<br>},<br>{<br>"logger_type": "STREAM",<br>"log_level": "ERROR"<br>}<br>]<br>}<br>``` |
| Store trace/verbose logging in memory, but if an error<br>occurs write to the logs | Enable "Store trace/verbose logging in memory, but if an error occurs write to the logs"<br><br>```<br>{<br>	"trace_on_error":true<br>}<br>```<br><br>Disable "Store trace/verbose logging in memory, but if an error occurs write to the logs"<br><br>```<br>{<br>	"trace_on_error":false<br>}<br>```<br><br>Change the "Allocate memory up to (MB)" value:<br><br>```<br>{<br>	"trace_on_error":true,<br>	"trace_on_error_size_mb":20<br>}<br>``` |

### Example

```
task_loggers = AemTaskLoggers(json.dumps({"loggers":[{"logger_type": "AT_GLOBAL","log_level": "INFO"}]}))
example_program.aem_client.put_task_loggers(task_loggers, "MyServerName", "MyTaskName")
```

## Getting all settings, except Replicate loggers, the task description, and error handling

Call task\_settings\_patch\_template to get current values for all settings, except Replicate loggers, the task description, and error handling settings.

### Syntax

def task\_settings\_patch\_template(self, payload, server, task)

### Parameters

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| payload | string | The JSON payload consisting of the settings.<br><br>Payload example:<br><br>Find out if LOB support is enabled, the maximum LOB size, and the target schema:<br><br>```<br>[<br>{ "path": "/common_settings/support_lobs" },<br>{ "path": "/target_settings/default_schema" },<br>{ "path": "/common_settings/lob_max_size" }<br>]<br>``` |
| server | string | The Replicate server name as defined in Enterprise Manager.<br><br>Example:<br><br>myrepsrv1 |
| task | string | The name of an existing task. |

### Example

```
setting = json.dumps([{"path": "/common_settings/support_lobs"}])
print(example_program.aem_client.task_settings_patch_template(setting, "MyServerName", "MyTaskName"))
```

## Getting the task description

Call get\_task\_properties to get the current task description.

### Syntax

def get\_task\_properties(self, server, task)

### Parameters

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| server | string | The Replicate server name as defined in Enterprise Manager.<br><br>Example:<br><br>myrepsrv1 |
| task | string | The name of an existing task. |

### Example

```
example_program = ExamplePythonProgram()
 task_properties = example_program.aem_client.get_task_properties("MyServerName", "MyTaskName")
 print(json.dumps(AttUtil.attobject_to_json(task_properties), indent=3))
```

## Getting the task error settings

Call get\_task\_eror\_behavior to get the current task error settings.

### Syntax

def get\_task\_eror\_behavior(self, server, task)

### Parameters

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| server | string | The Replicate server name as defined in Enterprise Manager.<br><br>Example:<br><br>myrepsrv1 |
| task | string | The name of an existing task. |

### Example

```
example_program = ExamplePythonProgram() 
 error_behavior = example_program.aem_client.get_task_error_behavior("MyServerName", "MyTaskName") 
 print(json.dumps(AttUtil.attobject_to_json(error_behavior), indent=3))
```

## Getting the task logger settings

Call get\_task\_loggers to get the current task logger settings.

### Syntax

def get\_task\_loggers(self, server, task)

### Parameters

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| server | string | The Replicate server name as defined in Enterprise Manager.<br><br>Example:<br><br>myrepsrv1 |
| task | string | The name of an existing task. |

### Example

```
example_program = ExamplePythonProgram()
 loggers = example_program.aem_client.get_task_loggers("MyServerName", "MyTaskName")
 print(json.dumps(AttUtil.attobject_to_json(loggers), indent=3))
```

## Errors

Apart from specific errors related to settings that are not valid, you might also encounter general errors. For more information on these, see [general errors](https://help.qlik.com/en-US/enterprise-manager/May2026/Content/EnterpriseManager/EnterpriseManager_APIGuide/CurlAPI/error_handling.htm).